import { Router } from 'express';

const router = Router();

import Valid from '../../middleware/validation';
import { create, detail, list, remove } from './api';

// 创建 app POST:/api/app
router.post('/', Valid.body(create.validator), create.api);
// 删除 app DELETE:/api/app/:ID
router.delete('/:ID', Valid.params(remove.validator), remove.api);
// 获取 app 列表 GET:/api/app
router.get('/', Valid.query(list.validator), list.api);
// 获取 app 详情 GET:/api/app/:ID
router.get('/:ID', Valid.params(detail.validator), detail.api);

export default router;
